onattemptrecover

SoftwareShield ClientProtector COM Component > ClientProtector (SSCProtector) Reference > OnAttemptRecover

## OnAttemptRecover

OnAttemptRecover is an event function of the ClientProtector dispatch interface. If you are using the Prompt To Recover option in the license, this event will fire upon StartUp if the license needs to be "recovered" for any reason. Your application can respond to this event by implementing it and subscribing to the event interface, providing a synchronous means for the user to input an Activation Code to recover the license (for which you control the user interface).

###### Syntax

void OnAttemptRecover ( BSTR RecoverAuthRequestCode, BSTR * InputActivationCode );

###### Parameters

RecoverAuthRequestCode

[IN] This is a wide string containing the Authorization Request Code corresponding to the first Recover Authorization Definition found in the license.

InputActivationCode

[OUT] This is a (pointer to a) wide character string (of any length) that you return to the ClientProtector when responding to this event. It should be set to the Activation Code that will (potentially) recover the license. Normally, you will collect this code through your user interface from the user.

###### Remarks

OnAttemptRecover is an event function of the ClientProtector dispatch interface. If you are using the Prompt To Recover option in the license, this event will fire upon StartUp if the license needs to be "recovered" for any reason. Your application can respond to this event by implementing it and subscribing to the event interface, providing a synchronous means for the user to input an Activation Code to recover the license (for which you control the user interface).

If you are using Prompt To Recover, you should implement this function. However, recovering the license can just as easily be done outside the scope of the StartUp call. The event handler provides a "first-response" synchronous method for you to query the user about recovering a license that has a problem. It is generally preferable to use the event handler to recover a license (when needed).

The RecoverAuthRequestCode parameter will contain the Authorization Request Code corresponding to the first Recover Authorization Definition found in the license. You will (probably) provide this to the user along with an explanation of what needs to be done to obtain an Activation Code from you to perform the recovery.

Your application would then collect an Activation Code from the user and send it back to the ClientProtector in the InputActivationCode parameter. The code will be validated and if successful will recover the license.

See the SoftwareShield ClientProtector Control Flow Charts for more information about where this event fires and how it handles the logic around recovering a license.

###### Return Value

Your event handler does not need to return a value.

###### Function Information

Exposed By Interface: | "ISSCProtector"
Exposed In COM Server Binaries: | "SSCProt.dll" and "SSCProtD.dll"